Validation of nearest neighbor classifiers

ABSTRACT

A computer-based system computes a probabilistic bound on the error probability of a nearest neighbor classifier as follows. A subset of the examples in the classifier is used to form a reduced classifier. The error frequency of the reduced classifier on the remaining examples is computed as a baseline estimate of the error probability for the original classifier. Additionally, subsets of the examples outside the reduced classifier are combined with the reduced classifier and applied to the remaining examples in order to estimate the difference in error probability for the reduced classifier and error probability for the original classifier.

CROSS-REFERENCE TO RELATED APPLICATIONS

This invention relates to Provisional Application Ser. No. 60/184,459, filed Feb. 22, 2000. The contents of the application are incorporated by reference.

STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

Not Applicable

REFERENCE TO A MICROFICHE APPENDIX

Not Applicable

BACKGROUND OF THE INVENTION

A classifier is a process or device that categorizes inputs. For example, a quality-control classifier may take measurements of an item as inputs and return a result of “defective” or “not defective.” Another example could be an iceberg-detecting classifier that takes as input a satellite image of an ocean area and produces as output either “iceberg” or “no iceberg.”

As another example, consider an email router system designed to be deployed in a crisis relief situation. The system users can be divided into groups according to interests, including “medical”, “food”, and “transport.” For each group, a classifier could be designed to determine whether an input email is of interest to the group. When an email is received by the system, each classifier can be applied, and the classifier results can determine which groups are sent the email. For example, an email detailing when blood supplies will arrive at an airport should be routed to the members of the “medical” and “transport” groups.

A “nearest neighbor” classifier is based on a set of inputs for which the categories are known. These input-output pairs are called the “in-sample” examples. The nearest neighbor classifier also includes a means of determining some measure of distance between inputs. When an “out-of-sample” input is encountered, the nearest neighbor classifier determines which in-sample example has the closest input and returns the corresponding output.

For the email router example, a nearest neighbor classifier for the medical group could consist of email messages from previous crises, with each message categorized as either “medically interesting” or “not medically interesting.” These are the in-sample examples. The distance measure between pairs of emails could be based on the number of words shared by the emails. To determine whether an out-of-sample email should be routed to medical personnel, the classifier would find the closest in-sample email. If that in-sample email is categorized as “medically interesting”, then the classifier would categorize the out-of-sample email as “medically interesting.”

Accuracy is a major concern in the development, selection, and decision whether to deploy a classifier. The probability that a classifier will incorrectly classify an input drawn at random is known as the expected error rate. (The expected error rate is also called the error probability.) Methods to estimate the expected error rate are called validation techniques. Effective validation techniques are needed so that classifiers can be selected for low expected error rates and so that classifier results can be used with appropriate levels of trust.

Now we describe prior art. One method to validate a nearest neighbor classifier is to remove some examples from the in-sample data to form a validation data set, use the remaining examples to form the classifier, then use the error rate of the classifier over the validation data as an estimate of the expected error rate. The drawback of this method is that the resulting classifier does not include the validation examples. On average, having fewer examples in a classifier results in a higher expected error rate. Hence, the primary goal of forming an accurate classifier suffers in order to accomplish the secondary goal of assessing the accuracy.

There are two prior validation techniques to obtain probabilistic bounds on the expected error rates for classifiers formed using all in-sample examples. Both methods are based on using in-sample examples to validate classifiers based on subsets of the remaining in-sample examples, then bounding the difference in error rates between the classifiers consisting of subsets of the in-sample examples and classifiers consisting of all in-sample examples. One method is based on the “leave-one-out” estimate, which is the error rate of applying the classifier consisting of the remaining in-sample examples to each in-sample example. This method is described in “Distribution-Free Inequalities for the Deleted and Holdout Estimates” by L. Devroye and T. Wagner, published in IEEE Transactions on Information Theory, Volume 25, 1979, pages 202 to 207, which is included in its entirety by reference. The other method is based on the “holdout” estimate, which is the error rate of applying the classifier consisting of a subset of the in-sample examples to the remaining in-sample examples. This method is also described in the paper “Distribution-Free Inequalities for the Deleted and Holdout Estimates.”

BRIEF SUMMARY OF THE INVENTION

The invention is a computer-based system to obtain probabilistic bounds on the expected error rate for a nearest neighbor classifier. The estimate used in the bound is an extension of the holdout estimate. The difference in error rates between the holdout classifier and classifier consisting of all in-sample examples is estimated using truncated inclusion and exclusion.

The bounds are computed as follows. Partition the in-sample examples into validation examples and remaining examples. Form a reduced classifier from the remaining examples. Use the error rate of the reduced classifier over the validation examples to estimate the expected error rate of the reduced classifier. Then estimate the difference in expected error rates between the reduced classifier and the full classifier as follows. Partition the validation examples into two “holdout” subsets. Then use each holdout subset to estimate the difference in expected error rate due to including the other holdout subset in the full classifier.

The bound is based only on the examples that comprise the classifier. Thus, all available examples can be used in the classifier; no examples need to be withheld to compute error bounds. Also, the probability that the prior “leave-one-out” and “holdout” error bounds are weaker than those produced by the process described here is shown to be large in “Validation of Nearest Neighbor Classifiers” by Eric Bax, published in IEEE Transactions on Information Theory, Volume 46, Number 7, 2000, pages 2746 to 2752, which is included in its entirety by reference.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWING

FIG. 1 is a flowchart that illustrates some steps in a process performed by the system that is the invention; notes in boxes describe process steps, and notes beside arrows describe data transferred between steps.

DETAILED DESCRIPTION OF THE INVENTION

The first subsection presents the mathematical framework surrounding the invention. The next subsection explains how to produce the error bounds. The following subsection details how to use unlabelled inputs to strengthen the bounds and explains a process to bound the error rate over out-of-sample data with known inputs.

Framework

Consider the following machine learning framework. There is a joint input-output distribution. For example, the input distribution could consist of typical satellite images of the North Atlantic Ocean, and the output could be 1 if the image contains a large iceberg and 0 otherwise.

We have a set of in-sample data examples, S={(x₁, θ₁), . . . , (x_(n), θ_(n))}, with each example drawn i.i.d. from the joint input-output distribution. We will use a nearest neighbor classifier, composed of the in-sample examples and a distance metric, to classify the inputs of test examples drawn i.i.d. from the input-output distribution. For each test input, the classifier returns the output corresponding to the closest in-sample input. The test error rate is the fraction of test inputs for which the classifier and the test output disagree. The underlying error rate, L_(n), is the expected test error rate over the input-output distribution. (We also refer to L_(n) as the error probability.) The average of L_(n) over all size n in-sample data sets drawn from the input-output distribution is R_(n). To make the definitions of L_(n) and R_(n) explicit, let y_(NN) be the output of the nearest neighbor classifier, and let y be the test output. Then

L _(n) =Pr{y _(NN) ≠y|S}  (1)

and

R _(n) =E _(S) L _(n) =Pr{y _(NN) ≠y}.  (2)

(We use subscripts to denote the distributions over which expectations are taken.) The bounds produced by this invention apply to L_(n), the error rate of the classifier at hand, not to R_(n), the average error rate over randomly drawn classifiers.

Bounds

Recall that S={(x₁, θ₁), . . . , (x_(n), θ_(n))} is the set of in-sample examples, with each example drawn i.i.d. from the joint input-output distribution. Without reference to the examples, choose positive values |Z| and |V| such that |S|=|Z|+|V|, and choose positive values |A| and |B| such that |V|=|A|+|B|. Partition S into a validation set V={(x₁, θ₁), . . . , (x_(|v|), θ_(|v|))} and a remaining set Z=S−V. Partition V into “holdout” sets A={(x₁, θ₁), . . . , (x_(|A|), θ_(|A|))} and B=V−A. Define C_(Z), C_(Z∪A), C_(Z∪B), and C_(S) to be the classifiers composed of the sets in the subscripts.

Denote conditional error probabilities, given the sample S, by p(S) with four bit-valued subscripts corresponding to C_(Z), C_(Z∪A), C_(Z∪B), and C_(S), respectively. Value 1 indicates an error, value 0 indicates no error, and value x indicates either. For example, p_(10x1)(S) is the probability that C_(Z) is incorrect, C_(Z∪A) is correct, C_(Z∪B) is either correct or incorrect, and C_(S) is incorrect for an example drawn at random from the input-output distribution.

Our goal is to develop bounds for p_(xxx1)(S), which is L_(n), the conditional probability, given the sample S, that C_(S) is incorrect. The bounds will be probabilistic, based on probabilities over random drawings of sets of in-sample examples. So our bounds will be of the form:

Pr{p _(xxx1)(S)≧υ(S)+ε}≦c(ε)  (3)

where υ(S) is an estimate of p_(xxx1)(S)=L_(n), c(ε) expresses the certainty of the bound, and Pr{} indicates probability over the distribution from which S is drawn.

Note that

p _(xxx1)(S)=[p _(1xxx)(S)+p _(01xx)(S)−p _(10xx)(S)+p _(0x1x)(S)−p _(1x0x)(S)]  (4)

+[p₁₀₀₀(S)+p₁₀₁₁(S)+p₁₁₀₁(S)−p₀₀₁₀(S)−p₀₁₀₀(S)−p₀₁₁₁(S)]  (5)

+[p₀₀₀₁(S)−2p₀₁₁₀(S)+2p₁₀₀₁(S)−p₁₁₁₀(S)]  (6)

(To prove this, expand about x's, e.g., p_(000x)(S)=p₀₀₀₁(S)+p₀₀₀₁(S). Then collect terms.)

Define

p _(est)(S)=p _(1xxx)(S)+p _(01xx)(S)−p _(10xx)(S)+p _(0x1x)(S)−p _(1x0x)(S).  (7)

The first term of p_(est)(S) is the error probability of C_(Z). The next two terms are the difference in error probability between C_(Z∪A) and C_(Z). The last two terms are the difference in error probability between C_(Z∪B) and C_(Z).

Define

p _(res)(S)=p ₁₀₀₀(S)+p ₁₀₁₁(S)+p ₁₁₀₁(S)−p ₀₁₀₀(S)−p ₀₁₀₀(S)−p ₀₁₁₁(S).  (8)

Define

p _(zero)(S)=p ₀₀₀₁(S)−2p ₀₁₁₀(S)+2p ₁₀₀₁(S)−p ₁₁₁₀(S).  (9)

Consider the terms in p_(zero)(S). Since C_(S) is composed of the examples Z∪A∪B, it is impossible for C_(S) to disagree with both C_(Z∪A) and C_(Z∪B). (This is a property of the nearest neighbor rule.) Hence,

p ₀₀₀₁(S)=p ₀₁₁₀(S)=p ₁₀₀₁(S)=p ₁₁₁₀(S)=0.  (10)

So

p _(zero)(S)=0.  (11)

(Break nearest neighbor ties using randomization, with the same randomizing random variables for all classifiers. That is, when each input is drawn from the input distribution, draw a corresponding random value from the uniform distribution over [0, 1]. If multiple inputs in a classifier have the same distance from an input to be classified, then use the corresponding random values to settle the tie—treat the tied classifier input with the closest random value to the random value for the input to be classified as the nearest neighbor. This tie-breaking method fails, i.e., multiple classifier inputs tie in both the original distance and in the random value, with probability zero. Hence, this case does not affect probability-based bounds. If the random values are computer-generated then the probability that the tie-breaking method fails is nonzero, but extremely small. In case of failure, add another random-valued element to each input, and consult the new element only when there is a tie using the previous element. Add more elements as needed to resolve all ties.)

We will use frequencies to estimate p_(est)(S). Denote the frequency of an error pattern by ƒ(S), with a subscript to indicate the error pattern and a superscript to indicate the samples over which the frequency is measured. For example, ƒ_(1xxx) ^(A∪B)(S) is the error frequency of C_(Z) over the examples in A∪B.

Since the examples in A∪B are drawn independently of the examples that form C_(Z), for each Z, ƒ_(1xxx) ^(A∪B)(S)|Z is the average of |A∪B| i.i.d. Bernoulli variables, each with mean p_(1xxx)(S)|Z, which is a constant value. By Hoeffding's inequality,

∀Z: Pr{p _(1xxx)(S)≧ƒ_(1xxx) ^(A∪B)(S)+ε|Z}≦e ^(−2|A∪B|ε) ² .  (12)

(Hoeffding's inequality is explained in “Probability Inequalities for Sums of Bounded Random Variables” by W. Hoeffding, published in the American Statistical Association Journal, 1963, pages 13 to 30, and hereby incorporated in its entirety by reference.)

Note that

Pr{p _(1xxx)(S)≧ƒ_(1xxx) ^(A∪B)(S)+ε}  (13)

=E _(z) [Pr{p _(1xxx)(S)≧ƒ_(1xxx) ^(A∪B)(S)+ε|Z}].  (14)

By Inequality 12, this expectation is:

≦E _(Z) e ^(−2|A∪B|ε) ² =e ^(−2|A∪B|ε) ² .  (15)

So

Pr{p _(1xxx)(S)≧ƒ_(1xxx) ^(A∪B)(S)+ε}≦e ^(−2|A∪B|ε) ² .  (16)

Similarly,

Pr{p _(1xxx)(S)≦ƒ_(1xxx) ^(A∪B)(S)−ε}≦e ^(−2|A∪B|ε) ² .  (16)

Also, note that

E_(s)ƒ_(1xxx) ^(A∪B)(S)  (18)

E _(Z) [E _(A∪B)ƒ_(1xxx) ^(A∪B)(S)|Z]  (19)

=E _(z) p _(1xxx)(S)|Z=E _(s) p _(1xxx)(S).  (20)

So

E _(s)ƒ_(1xxx) ^(A∪B)(S)=E _(s) p _(1xxx)(S).  (21)

Inequalities similar to Inequalities 16 and 17 and equalities similar to Equality 21 hold for the following pairs, each consisting of a frequency and the corresponding term of p_(est)(S).

(ƒ_(01xx) ^(B)(S),p_(01xx)(S)),(ƒ_(10xx) ^(B)(S),p_(10xx)(S)),(ƒ_(0x1x) ^(A)(S),p_(0x1x)(S)), and (ƒ_(1x0x) ^(A)(S),p_(1x0x)(S)).  (22)

Define

ƒ_(est)(S)=ƒ_(1xxx) ^(A∪B)(S)+ƒ_(01xx) ^(B)(S)−ƒ_(10xx) ^(B)(S)+ƒ_(0x1x) ^(A)(S)−ƒ_(1x0x) ^(A)(S).  (23)

We will use frequencies to estimate a bound for p_(res)(S). For each error pattern in p_(res)(S), there are examples in both A and B that are closer to the input than any example in Z. (This is a property of the nearest neighbor rule.) To illustrate, consider pattern 0010. Since C_(Z)≠C_(Z∪B), there must be an example in B that is closer to the input than any example in Z. Now, since C_(Z∪B)≠C_(S), and S=Z∪A∪B, there must be an example in A that is closer to the input than any example in Z∪B. Hence, there must be a closer example in A than any example in Z.

Define p_(AB)(S) to be the probability that both A and B have closer examples to a random input than any example in Z. Without reference to the in-sample examples, choose a positive value |T|<|Z|. Let set T be composed of the first |T| examples in Z. Define p_(ABT)(S) to be the probability that both A and B have closer examples to a random input than any example in Z−T. Note that

∀S:p _(ABT)(S)≧p _(AB)(S)≧|p _(res)(S)|.  (24)

Since, for all S, p_(xxx1)(S)=p_(res)(S)+p_(res)(S),

∀S:p _(xxx1)(S)≦p _(est)(S)+p _(ABT)(S).  (25)

Let ƒ_(ABT)(S) be the frequency of examples in T that have closer examples in both A and B than any example in Z−T. For all S−T, ƒ_(ABT)(S)|(S−T) is the average of |T| i.i.d. Bernoulli variables, each with mean p_(ABT)(S)|(S−T). By Hoeffding's inequality,

∀(S−T):Pr{p _(ABT)(S)≧ƒ_(ABT)(S)+ε|(S−T)}≦e ^(−2|T|ε) ² .tm (26)

A derivation similar to that of Inequality 16 produces the following result.

Pr{p _(ABT)(S)≧ƒ_(ABT)(S)+ε}≦e ^(−2|T|ε) ² .  (27)

A derivation similar to that of Inequality 21 produces the following result.

E _(S)ƒ_(ABT)(S)=E _(S) p _(ABT)(S).  (28)

Consider ƒ_(est)(S)+ƒ_(ABT)(S)+ε, for some chosen ε, as a probabilistic upper bound for L_(n). Recall that L_(n)=p_(xxx1)(S). Then

Pr{L _(n)≧ƒ_(est)(S)+ƒ_(ABT)(S)+ε}=Pr{p _(xxx1)(S)≧ƒ_(est)(S)+ƒ_(ABT)(S)+ε}.  (29)

For all S, p_(xxx1)(S)≦p_(est)(S)+p_(ABT)(S), so the above expressions are

≦Pr{p _(est)(S)+p _(ABT)(S)≧ƒ_(est)(S)+ƒ_(ABT)(S)+ε}.  (30)

Expand p_(est)(S) and ƒ_(est)(S). Then the probability above is

=Pr{p _(1xxx)(S)+p_(01xx)(S)−p _(10xx)(S)+p _(0x1x)(S)−p _(1x0x)(S)+p _(ABT)(S)  (31)

≧ƒ_(1xxx) ^(A∪B)(S)+ƒ_(01xx) ^(B)(S)−ƒ_(10xx) ^(B)(S)+ƒ_(0x1x) ^(A)(S)−ƒ_(1x0x) ^(A)(S)+ƒ_(ABT)(S)+ε}.  (32)

Choose positive values ε₁, . . . , ε₆ such that ε₁+. . . +ε₆=ε. Use uniform bounds over estimates of individual probabilities by corresponding frequencies. The probability is

≦Pr{(p _(1xxx)(S)≧ƒ_(1xxx) ^(A∪B)(S)+ε₁) or (p _(01xx)(S)≧ƒ_(01xx) ^(B)(S)+ε₂)  (33)

or (p _(10xx)(S)≦ƒ_(10xx) ^(B)(S)−ε₃) or (p _(0x1x)(S)≧ƒ_(0x1x) ^(A)(S)+ε₄)  (34)

or (p _(1x0x)(S)≦ƒ_(1x0x) ^(A)(S)−ε₅) or (p _(ABT)(S)≧ƒ_(ABT)(S)+ε₆)}  (35)

Bound the probability of the union of events by the sum of the event probabilities. The probability is

≦Pr{p _(1xxx)(S)≧ƒ_(1xxx) ^(A∪B)(S)+ε₁ }+Pr{p _(01xx)(S)≧ƒ_(01xx) ^(B)(S)+ε₂}  (36)

+Pr{p _(10xx)(S)≦ƒ_(10xx) ^(B)(S)−ε₃ }+Pr{p _(0x1x)(S)≧ƒ_(0x1x) ^(A)(S)+ε₄}  (37)

+Pr{p _(1x0x)(S)≦ƒ_(1x0x) ^(A)(S)−ε₅ }+Pr{p _(ABT)(S)≧ƒ_(ABT)(S)+ε₆}  (38)

Use a Hoeffding-style bound for each probability. The bound is

≦e ^(−2|A∪B|ε) ^(₁) ² +e ^(−2|B|ε) ^(₂) ² +e ^(−2|B|ε) ^(₃) ² +e ^(−2|A|ε) ^(₄) ² +e ^(−2|A|ε) ^(₅) ² +e ^(−2|T|ε) ^(₆) ² .  (39)

Hence, for ε₁+. . . +ε₆=ε,

Pr{L _(n)≧ƒ_(est)(S)+ƒ_(ABT)(S)+ε}  (40)

≦e ^(−2|A∪B|ε) ^(₁) ² +e ^(−2|B|ε) ^(₂) ² +e ^(−2|B|ε) ^(₃) ² +e ^(−2|A|ε) ^(₄) ² +e ^(−2|A|ε) ^(₅) ² +e ^(−2|T|ε) ^(₆) ² .  (41)

To improve the bound, group the terms of ƒ_(est)(S) into two terms instead of the present five terms. One term consists of frequency contributions over A; the other term consists of frequency contributions over B. Define $\begin{matrix} {{f^{A}(S)} = {{\frac{A}{{A\bigcup B}}{f_{1{xxx}}^{A}(S)}} + {f_{0{x1x}}^{A}(S)} - {{f_{1{x0x}}^{A}(S)}.{Define}}}} & (42) \\ {{f^{B}(S)} = {{\frac{B}{{A\bigcup B}}{f_{1{xxx}}^{B}(S)}} + {f_{01{xx}}^{B}(S)} - {{f_{10{xx}}^{B}(S)}.}}} & (43) \end{matrix}$

Note that

ƒ_(est)(S)=ƒ^(A)(S)+ƒ^(B)(S).  (44)

Also, define $\begin{matrix} {{{p^{A}(S)} = {{\frac{A}{{A\bigcup B}}{p_{1{xxx}}(S)}} + {p_{0{x1x}}(S)} - {p_{1{x0x}}(S)}}},} & (45) \end{matrix}$

and define $\begin{matrix} {{p^{B}(S)} = {{\frac{B}{{A\bigcup B}}{p_{1{xxx}}(S)}} + {p_{01{xx}}(S)} - {{p_{10{xx}}(S)}.}}} & (46) \end{matrix}$

Note that

p _(est)(S)=p ^(A)(S)+p ^(B)(S).  (47)

Inequalities similar to Inequalities 16 and 17 relate the pairs (ƒ^(A)(S),p^(A)(S)) and (ƒ^(B)(S),p^(B)(S)). Let a_(i) be the contribution of the ith example in A to ƒ^(A)(S)|(S−A). Then $\begin{matrix} {a_{i} = \left\{ \begin{matrix} 0 & {{if}\quad C_{Z}\quad {is}\quad {correct}\quad {and}\quad C_{Z\bigcup B}\quad {is}\quad {correct}} \\ \frac{1}{A} & {{if}\quad C_{Z}\quad {is}\quad {correct}\quad {and}\quad C_{Z\bigcup B}\quad {is}\quad {{in}{correct}}} \\ {\frac{1}{{A} + {B}} - \frac{1}{A}} & {{if}\quad C_{Z}\quad {is}\quad {incorrect}\quad {and}\quad C_{Z\bigcup B}\quad {is}\quad {correct}} \\ \frac{1}{{A} + {B}} & {{if}\quad C_{Z}\quad {is}\quad {incorrect}\quad {and}\quad C_{Z\bigcup B}\quad {is}\quad {incorrect}} \end{matrix} \right.} & (48) \end{matrix}$

Note that each a_(i) has range $\left\lbrack {{\frac{1}{{A} + {B}} - \frac{1}{A}},\frac{1}{A}} \right\rbrack.$

Since ƒ^(A)(S)|(S−A) is the average of i.i.d. variables a₁, . . . , a_(|A|), each with mean p^(A)(S)|(S−A), by Hoeffding's inequality, $\begin{matrix} {\left. {{\forall\left( {S - A} \right)}:{\Pr \left\{ {{p^{A}(S)} \geq {{f^{A}(S)} + {\varepsilon {\left( {S - A} \right)}}}} \right.}} \right\} \leq ^{{- 2}{A}{\varepsilon^{2}/{({2 - \frac{A}{{A} + {B}}})}^{2}}}} & (49) \end{matrix}$

Taking the expectation over S−A yields the following bound for the probability over S. $\begin{matrix} {{\Pr \left\{ {{p^{A}(S)} \geq {{f^{A}(S)} + \varepsilon}} \right\}} \leq {^{{- 2}{A}{\varepsilon^{2}/{({2 - \frac{A}{{A} + {B}}})}^{2}}}.}} & (50) \end{matrix}$

Similarly, $\begin{matrix} {{\Pr \left\{ {{p^{B}(S)} \geq {{f^{B}(S)} + \varepsilon}} \right\}} \leq {^{{- 2}{B}{\varepsilon^{2}/{({2 - \frac{A}{{A} + {B}}})}^{2}}}.}} & (51) \end{matrix}$

Following the process to derive Inequality 41,

Pr{L _(n)≧ƒ_(est)(S)+ƒ_(ABT)(S)+ε}  (52)

≦Pr{p ^(A)(S)+p ^(B)(S)+p _(ABT)(S)≧ƒ^(A)(S)+ƒ^(B)(S)+ƒ_(ABT)(S)+ε}.  (53)

Choose positive quantities ε_(A), ε_(B), and ε_(T) such that ε_(A)+ε_(B)+ε_(T)=ε. Then the above expression is

≦Pr{p ^(A)(S)≧ƒ^(A)(S)+ε_(A) }+Pr{p ^(B)(S)≧ƒ^(B)(S)+ε_(B) }+Pr{p _(ABT)(S)≧ƒ_(ABT)(S)+ε_(T)}.  (54)

By the Hoeffding bounds, this is $\begin{matrix} {\leq {^{{- 2}{A}{\varepsilon_{A}^{2}/{({2 - \frac{A}{{A} + {B}}})}^{2}}} + ^{{- 2}{B}{\varepsilon_{B}^{2}/{({2 - \frac{B}{{A} + {B}}})}^{2}}} + {^{{- 2}{T}\varepsilon_{T}^{2}}.}}} & (55) \end{matrix}$

So

Pr{L _(n)≧ƒ_(est)(S)+ƒ_(ABT)(S)+ε}  (56)

$\begin{matrix} {\leq {^{{- 2}{A}{\varepsilon_{A}^{2}/{({2 - \frac{A}{{A} + {B}}})}^{2}}} + ^{{- 2}{B}{\varepsilon_{B}^{2}/{({2 - \frac{B}{{A} + {B}}})}^{2}}} + {^{{- 2}{T}\varepsilon_{T}^{2}}.}}} & (57) \end{matrix}$

To derive a similar lower bound, recall that for all S, L _(n)=p_(est)(S)+p _(res)(S) and p_(ABT)(S)≧|p_(res)(S)|. So

∀S:L _(n) ≦p _(est)(S)−p _(ABT)(S),  (58)

and the probabilistic lower bound for L_(n) is as follows.

Pr{L _(n)≦ƒ_(est)(S)−ƒ_(ABT)(S)−ε}  (59)

$\begin{matrix} {\leq {e^{{- 2}{A}{\varepsilon_{A}^{2}/{({2 - \frac{A}{{A} + {B}}})}^{2}}} + e^{{- 2}{B}{\varepsilon_{B}^{2}/{({2 - \frac{B}{{A} + {B}}})}^{2}}} + e^{{- 2}{T}{\varepsilon_{T}^{2}.}}}} & (60) \end{matrix}$

Combine the upper and lower bounds to form the following two-sided bound.

Pr{(ƒ _(est)(S)−L _(n))[−ƒ_(ABT)(S)−ε,ƒ_(ABT)(S)+ε]}  (61)

$\begin{matrix} {\leq {{2\left\lbrack {e^{{- 2}{A}{\varepsilon_{A}^{2}/{({2 - \frac{A}{{A} + {B}}})}^{2}}} + e^{{- 2}{B}{\varepsilon_{B}^{2}/{({2 - \frac{B}{{A} + {B}}})}^{2}}} + e^{{- 2}{T}\varepsilon_{T}^{2}}} \right\rbrack}.}} & (62) \end{matrix}$

It will be apparent to those skilled in the art that the bounds can be optimized through choices of |A|, |B|, |T|, ε_(A), ε_(b), ε_(T).

To review, the algorithm to compute the two-sided bounds is summarized below.

1. Read in S, the set of in-sample examples. Read in sizes for subsets of S:

|V|, |A|, |B|, and |T|. Also read in ε_(A), ε_(B), and ε_(T). Set ε to ε_(A)+ε_(b)+ε_(T).

2. Partition set S into a validation set V and a remaining set Z.

3. Partition set V into sets A and B.

4. Use Equation 23 to compute the frequency-based error estimate ƒ_(est)(S).

5. Partition set Z into sets T and Z−T.

6. Compute ƒ_(ABT)(S), which is the frequency of examples in T that have closer examples in both A and B than any example in Z−T.

7. Substitute the values for ƒ_(est)(S), ƒ_(ABT)(S), |A|, |B|, |T|, ε, ε_(A), ε_(B), and ε_(T) into Inequality 61 and 62, simplify terms, and return the result as a probabilistic bound on the expected error rate.

It will be apparent to those skilled in the art of computer programming that the above algorithm, as well as similar algorithms for one-sided bounds, may be implemented using a computer system that includes the following components.

A computer comprising a memory device and a central processing unit (CPU)

application software (comprising programs to accomplish the following means)

means to read a set of in-sample examples into the memory device of the computer

means to specify a partition of the in-sample examples into a validation set and a remaining set

means to specify a partition of the validation set into two holdout sets, a first holdout set and a second holdout set

means to compute the frequency, over the validation set, of inputs for which the classifier based on the remaining set is incorrect

means to compute the difference in two frequencies over the second holdout set, the first frequency being of inputs for which the classifier based on the remaining set is correct but the classifier based on both the remaining set and the first holdout set is incorrect, the second frequency being of inputs for which the classifier based on the remaining set is incorrect but the classifier based on both the remaining set and the first holdout set is correct

means to compute the difference in two frequencies over the first holdout set, the first frequency of inputs for which the classifier based on the remaining set is correct but the classifier based on both the remaining set and the second holdout set is incorrect, the second frequency of inputs for which the classifier based on the remaining set is incorrect but the classifier based on both the remaining set and the second holdout set is correct.

means to specify a partition of the remaining set into a core set and a non-core set

means to compute the frequency, over the non-core set, of inputs with at least one closer input in each holdout set than the closest input in the core set

The methods to construct these components and combine them into a system that computes bounds will be apparent to those skilled in the art of computer programming.

Unlabelled Inputs and Test Inputs

Let D be a set of inputs drawn i.i.d. from the input distribution. Define ƒ_(AB) ^(D)(S∪D) to be the frequency over inputs in D with which both A and B have examples closer to the input than any example in Z. Since E_(S)f_(AB)^(D)(S⋃D) = _(AB)(S), f_(AB)^(D)(S⋃D)

can be used in place of ƒ_(ABT)(S) in the bounds, replacing |T| by |D|. If it is possible to produce as many inputs as desired, then p_(AB)(S) can be estimated with arbitrary accuracy and confidence.

It will be apparent to those skilled in the art of computer programming that the bound-producing algorithms may be augmented through the use of set D by using a computer system with components as specified previously and augmented with the following components.

means to read a set of unlabelled inputs into the memory device of the computer

means to compute the frequency, over the unlabelled inputs, of inputs with at least one closer input in each holdout set than the closest input in the remaining set.

If only a few unlabelled inputs are available, then p_(ABT)(S) should be estimated using both unlabelled inputs and in-sample examples, as follows. Let ƒ_(ABT) ^(D∪T)(S∪D) be the frequency over inputs in D∪T with which both A and B have examples closer to the input than any input in Z−T. Since (E_(s)ƒ_(ABT) ^(D∪T)(S∪D)=p_(ABT)(S), ƒ_(ABT) ^(D∪T)(S∪D) can be used in place of ƒ_(ABT)(S) in the bounds, replacing |T| by |D∪T|.

It will be apparent to those skilled in the art of computer programming that the bound-producing algorithms may be augmented through the use of set D∪T by using a computer system with the previously specified components and augmented with the following component.

means to compute the frequency, over the unlabelled inputs and non-core inputs, of inputs with at least one closer input in each holdout set than the closest input in the core set.

Now suppose that we wish to bound the test error rate over a set of available test inputs Q drawn i.i.d. from the input distribution, i.e., we wish to bound ƒ_(xxx1) ^(Q)(S∪Q). As an analog to p_(est)(S), define

ƒ_(est) ^(Q)(S∪Q)=ƒ_(1xxx) ^(Q)(S∪Q)+ƒ_(01xx) ^(Q)(S∪Q)−ƒ_(10xx) ^(Q)(S∪Q)+ƒ_(0x1x) ^(Q)(S∪Q)−ƒ_(1x0x) ^(Q)(S∪Q).  (63)

Note that E_(S∪Q)ƒ_(est)(S)=E_(S∪Q)ƒ_(est) ^(Q)(S∪Q). By Inequality (2.7) of the paper by Hoeffding,

Pr{ƒ _(est) ^(Q)(S∪Q)≧ƒ_(est)(S)+ε}  (64)

$\begin{matrix} {\leq {e^{{- 2}{\varepsilon_{A}^{2}/{({{A}^{- 1} + {Q}^{- 1}})}}{({2 - \frac{A}{{A} + {B}}})}^{2}} + e^{{- 2}{\varepsilon_{B}^{2}/{({{B}^{- 1} + {Q}^{- 1}})}}{({2 - \frac{B}{{A} + {B}}})}^{2}}}} & (65) \end{matrix}$

where ε=ε_(A)+ε_(B) and the probability is over the distribution of S∪Q. Define ƒ_(AB) ^(Q)(S∪Q) to be the frequency with which test inputs have closer examples in both A and B than any example in Z. Since the test inputs are known, ƒ_(AB) ^(Q)(S∪Q) can be computed exactly. Note that

∀(S∪Q):ƒ_(est) ^(Q)(S∪Q)+ƒ_(AB) ^(Q)(S∪Q)≧ƒ_(xxx1) ^(Q)(S∪Q).  (66)

Hence, we have the following upper bound on test error rate.

Pr{ƒ _(xxx1) ^(Q)(S∪Q)≧ƒ_(est)(S)+ƒ_(AB) ^(Q)(S∪Q)+ε}  (67)

$\begin{matrix} {\leq {e^{{- 2}{\varepsilon_{A}^{2}/{({{A}^{- 1} + {Q}^{- 1}})}}{({2 - \frac{A}{{A} + {B}}})}^{2}} + e^{{- 2}{\varepsilon_{B}^{2}/{({{B}^{- 1} + {Q}^{- 1}})}}{({2 - \frac{B}{{A} + {B}}})}^{2}}}} & (68) \end{matrix}$

where the probability is over the distribution of S∪Q. 

I claim:
 1. A system comprising: a computer comprising a memory device and a central processing unit (CPU); application software; means to read a set of in-sample examples into the memory device of the computer; means to specify a partition of the in-sample examples into a validation set and a remaining set; means to specify a partition of the validation set into two holdout sets, a first holdout set and a second holdout set; means to compute the frequency, over the validation set, of inputs for which the classifier based on the remaining set is incorrect; means to compute the difference in two frequencies over the second holdout set, the first frequency being of inputs for which the classifier based on the remaining set is correct but the classifier based on both the remaining set and the first holdout set is incorrect, the second frequency being of inputs for which the classifier based on the remaining set is incorrect but the classifier based on both the remaining set and the first holdout set is correct; and means to compute the difference in two frequencies over the first holdout set, the first frequency of inputs for which the classifier based on the remaining set is correct but the classifier based on both the remaining set and the second holdout set is incorrect, the second frequency of inputs for which the classifier based on the remaining set is incorrect but the classifier based on both the remaining set and the second holdout set is correct.
 2. The system as recited in claim 1, further comprising: means to specify a partition of the remaining set into a core set and a non-core set; and means to compute the frequency, over the non-core set, of inputs with at least one closer input in each holdout set than the closest input in the core set.
 3. The system as recited in claim 1, further comprising: means to read a set of unlabelled inputs into the memory device of the computer; and means to compute the frequency, over the unlabelled inputs, of inputs with at least one closer input in each holdout set than the closest input in the remaining set.
 4. The system as recited in claim 1, further comprising: means to specify a partition of the remaining set into a core set and a non-core set; means to read a set of unlabelled inputs into the memory device of the computer; and means to compute the frequency, over the unlabelled inputs and non-core inputs, of inputs with at least one closer input in each holdout set than the closest input in the core set. 